package udtf;

import com.aliyun.odps.udf.ExecutionContext;
import com.aliyun.odps.udf.UDFException;
import com.aliyun.odps.udf.UDTF;
import com.aliyun.odps.udf.annotation.Resolve;

/**
 * a,1,2,3,4,5,6,7,8,9,10,11,12
 * b,13,14,15,16,17,18,19,20,21,22,23,24
 * c,25,26,27,28,29,30,31,32,33,34,35,36
 */
// TODO define input and output types, e.g. "string,string->string,bigint".
@Resolve({"string,*->string,string,string"})
public class MyUDTFDemo1 extends UDTF {
    @Override
    public void process(Object[] args) throws UDFException {
      //a,1,2,3,4,5,6,7,8,9,10,11,12
      //输出：
      // a  0时  1
      String id = args[0].toString();
      int t = 0;
      for (int i = 1; i < args.length; i++) {
        forward(id,t + "时",args[i].toString());
        t += 2;
      }
    }

}